{{if $page}}
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1"
        xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
    {{loop $datalist $item}}
    <url> 
    <loc>{{Router::url('/'.$controller_name.'/'.date('Ymd',strtotime($item[$modelname]['created'])).'/'.$item[$modelname]['id'].'.html',true)}}</loc> 
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
    </url>
    {{/loop}}
</urlset>
{{else}}
<?php 
// http://www.google.com/support/webmasters/bin/answer.py?hl=zh-Hans&answer=71453
echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <?PHP for($i=1;$i<=$totalpage;$i++) { ?>
   <sitemap>
      <loc>{{Router::url(array('controller'=>'sitemaps','action'=>'google',$modelClass,$i),true)}}</loc>      
   </sitemap>
    <? } ?>
</sitemapindex>
{{/if}}
